package org.ykh.service.policy;


import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.time.Duration;

/**
 * @author ykh
 */
@Component
public interface RestrictPolicy {
    /**
     * 是否需要限制
     * @return
     */
    boolean isRestrict(HttpServletRequest request, String encoded, Duration interval,int threshold);
    /**
     * 限制策略
     */
    void restrictPolicy(HttpServletRequest request, String encoded, Duration interval,int threshold);

}
